<?php
error_reporting(-1);
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
session_start();
require_once "./includes/config.php";
require_once './classes/Auth.class.php';

$pid=$_GET['pid'];

if(isset($pid))
{
	$DBH = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );
	$sth = $DBH->prepare('update players set time=NOW() where pid="'.$pid.'"');
	$sth->execute();
	$sth = $DBH->prepare('select inGame from players where pid="'.$pid.'"');
	$sth->execute();
	
	while ($row = $sth->fetch())
	{
		$inGame = $row['inGame'];
		Battlelog\User::UpdateUserINGAME($inGame);
	}
}

$DBH = null;
?>

